<style>
    .jj:hover{
        color:red;
    }
    .status:hover{
        color:#0b93d5;
    }
    #btn-end{
        background-color:red;
    }
</style>
<table class="table table-striped">
    <thead>
    <tr>
        <th>任务名称</th>
        <th>用户名称</th>
        <th>饭店名称</th>
        <th>门头照</th>
        <th>备注</th>
        <th>状态</th>
        <th>报名时间</th>
        <th>平台确认时间</th>
        <th>金主确认完成时间</th>
        <th>结账时间戳</th>
        <th>查看地图</th>
    </tr>
    </thead>
    <tbody>
    {volist name="list" id="row"}
    <tr>
        <td>{$row.mission_id}</td>
        <td>{$row.user_id}</td>
        <td>{$row.company_name}</td>
        <td><img style="width:30px;height:30px;" src="{$row.company_photo}"/></td>
        <td>{$row.summary}</td>
        <td>
            <span  class="status" ids="{$row.id}" style="cursor:pointer;">{$row.status}</span>
            {if condition="$row['status'] eq '已报名'"}
                <br/>
                <span style="cursor:pointer;"class="jj" ids="{$row.id}">拒绝</span>
            {/if}
            </td>
        <td>{$row.create_time|date='Y-m-d',###}</td>
        <td>{$row.verify_time|date='Y-m-d',###}</td>
        <td>{$row.done_time|date='Y-m-d',###}</td>
        <td>{$row.pay_time|date='Y-m-d',###}</td>
        <td class="dt" style="cursor:pointer;" ide="{$row.id}">点击查看</td>
    </tr>

    {/volist}

    </tbody>
</table>
<div class="hide layer-footer">
    <label class="control-label col-xs-12 col-sm-2"></label>
    <div class="col-xs-12 col-sm-8">
        <button type="reset" id="#btn-end"class=" btn btn-primary btn-embossed " onclick="end({$ids})">已结束</button>
        <button type="reset" class="btn btn-primary btn-embossed btn-close" onclick="Layer.closeAll();">{:__('Close')}</button>
    </div>
</div>
<script src="__PUBLIC__assets/js/jquery-1.11.3.min.js"></script>
<script>
    $(function () {
        $('.status').click(function(){
            var id=$(this).attr('ids');
            $.ajax({
                url: "{:url('mul.missionemployee/modify')}",
                data:{'id':id},
                success: function(res){
                    layer.alert(res.msg,function(){
                        window.location.reload();
                    });
                }});
        });
        $('.jj').click(function(){
            var id=$(this).attr('ids');

            $.ajax({
                url: "{:url('mul.missionemployee/jj')}",
                data:{'id':id},
                success: function(res){
                    layer.alert(res.msg,function(){
                        window.location.reload();
                    });
                }});
        });
        $('.dt').click(function(){
            var that = this;
            var ids=$(this).attr('ide');
            layer.open({
                type: 2 //此处以iframe举例
                , title: '地图'
                , area: ['700px', '500px']
                , shade: 0
                , maxmin: true
                , offset: 'auto'
                ,scrollbar: false
                , content: "{:url('mul.missionemployee/dt')}?ids="+ids
                , btn: ['关闭'] //只是为了演示
                , yes: function () {
                    layer.closeAll();
                }


                , zIndex: layer.zIndex //重点1
                , success: function (layero) {
                    layer.setTop(layero); //重点2
                }
            });


        });

    });
    function end(id) {
        $.ajax({
            url: "{:url('mul.mission/end')}",
            data:{'id':id},
            success: function(res){
                if(res.code>0){
                    layer.alert(res.msg,function(){
                        parent.location.reload();
                    });
                }else{
                    layer.alert(res.msg);
                }
            }});
    }
</script>